package com.sh.mytool.cv.domain;

import static javax.persistence.GenerationType.AUTO;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.sh.mytool.cv.domain.Column;
import javax.persistence.OneToOne;
import static javax.persistence.CascadeType.REFRESH;
import javax.persistence.JoinColumn;
import static javax.persistence.FetchType.LAZY;
import static javax.persistence.CascadeType.REMOVE;

@Entity
@Table(name = "tb_article")
public class Article {

    @Id
    @GeneratedValue(strategy = AUTO)
    @javax.persistence.Column(name = "article_id", length = 20, nullable = false)
    private long id;

    @javax.persistence.Column(name = "article_content", length = 4000, nullable = true)
    private String content;

    @OneToOne(fetch = LAZY, cascade = { REFRESH, REMOVE }, optional = true)
    @JoinColumn(name = "column_id", referencedColumnName = "column_id")
    private Column column;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public void setContent(String param) {
        this.content = param;
    }

    public String getContent() {
        return content;
    }

    public Column getColumn() {
        return column;
    }

    public void setColumn(Column param) {
        this.column = param;
    }

}